package strategy;

import strategy.browser.BFSTreeBrowser;
import strategy.browser.DFSTreeBrowser;
import strategy.browser.TreeBrowser;

public class Main {

    private static TreeBrowser treeBrowser;

    public static void main(String[] args) {
        Node root = TreeBuilder.createTree();

        Node.INodeAction printIdDFS = new Node.INodeAction() {
            @Override
            public void doAction(Node node) {
                System.out.print(node.getIdDFS() + " ");
            }
        };

        treeBrowser = new DFSTreeBrowser();
        treeBrowser.browse(root, printIdDFS);

        // -----------------
        System.out.println();

        Node.INodeAction printIdBFS = new Node.INodeAction() {
            @Override
            public void doAction(Node node) {
                System.out.print(node.getIdBFS() + " ");
            }
        };

        treeBrowser = new BFSTreeBrowser();
        treeBrowser.browse(root, printIdBFS);
    }
}
